#!/bin/bash
#file_name: expect_1.sh
src_host=172.18.13.101
src_pwd=I23b8qbjjq
src_path=/szcg/tool/test.sh
src_user=root
expect -c "
spawn scp ${src_user}@${src_host}:${src_path} ${src_path} 
expect \"password:\"
send \"${src_pwd}\r\"
expect eof
"
